<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport"
    content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
  <meta name="author" content="火星科技 http://mars3d.cn " />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="x5-fullscreen" content="true" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  <!-- 标题及搜索关键字 -->
  <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
  <meta
    name="description"
    content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型  gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包  地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS" />

  <link rel="shortcut icon" type="image/x-icon" href="/img/favicon/favicon.ico" />
  <title>场景出图(导出图片) | Mars3D | 三维地图 | 火星科技 | 合肥火星科技有限公司</title>

  <!--第三方lib-->
  <script
    type="text/javascript"
    src="/lib/include-lib.js"
    libpath="/lib/"
    include="jquery,layer,toastr,font-awesome,bootstrap,layer,haoutil,mars3d"></script>

  <script type="text/javascript" src="/lib/dom2img/dom-to-image.js"></script>

  <link href="/css/style.css" rel="stylesheet" />
  <link href="/img/div-graphic/divGraphic.css" rel="stylesheet" />
  <style>
    .infoview {
      width: 213px;
    }

    .imgShorScreen {
      margin-bottom: 10px;
    }
  </style>
</head>

<body class="dark">
  <div id="mars3dContainer" class="mars3d-container"></div>

  <div class="infoview">
    <div class="f-mb">
      <input type="button" class="btn btn-primary" id="showMapImg" value="查看场景出图" />
    </div>
    <div class="f-mb">
      <input type="button" class="btn btn-primary" id="downLoad2" value="下载场景缩略图" />
    </div>
    <div class="f-mb">
      <input type="button" class="btn btn-primary" id="downLoad" value="下载场景出图" />
    </div>
    <div>
      <img class="f-mb imgShorScreen" id="shotScreenImg" style="display: none; width:100%" />
      <input type="button" class="btn btn-primary" id="shotScreenBtn" value="截图" />
    </div>
  </div>

  <script src="/js/common.js"></script>
  <script src="./map.js"></script>
  <script type="text/javascript">
    "use script" //开发环境建议开启严格模式

    function initUI(options) {
      // 查看场景出图
      $("#showMapImg").click(function () {
        showMapImg().then((image) => {
          //回调
          window.layer.open({
            type: 1,
            title: "场景出图",
            skin: "layer-mars-dialog animation-scale-up",
            resize: true,
            area: ["50%", "60%"], //宽高
            content: "<img src=" + image + ' style="width:100%;">'
          })
        })
      })

      $("#downLoad").click(function () {
        console.log("down")
        downLoad()
      })

      $("#downLoad2").click(function () {
        downLoad2()
      })

      $("#shotScreenBtn").click(function () {
        shotScreen()
      })
    }

    function shotScreen() {
      showMapImg().then((image) => {
        $("#shotScreenImg").show()
        $("#shotScreenImg").attr("src", image)
      })
    }
  </script>
</body>

</html>
